<?php $this->load->view('layout/lottery/header') ?>
<div class="lotteryMain">
	<ol class="breadcrumb">
		<li><a href="<?php echo site_url('lottery/index'); ?>">活动列表</a></li>
		<li>奖品列表</li>
	</ol>
	<div class="panel-heading">奖品列表 PRIZE LIST </div>

	<div class="lotteryList">
		<div class="caption clearfix">
			<a href="<?php echo site_url('lotteryprize/addPrize'), '?lottery_id=', $this->input->get('lottery_id'); ?>" class="btn"><span>+</span>添加奖品</a>
		</div>
		<?php if ($all_rows > 0) : ?>
		<table class="table table-striped mytable-striped">
			<thead>
				<tr>
					<th width="100">编号</th>
					<th width="240">奖品名称</th>
					<th width="100">等级</th>
					<th width="100">类型</th>
					<th width="100">审核状态</th>
					<th width="100">上下架</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<?php foreach ($page_list->result() as $item) : ?>
				<tr>
					<td><?php echo $item->prize_id; ?></td>
					<td><?php echo $item->prize_name; ?></td>
					<td><?php echo prizeGrade()[$item->grade], '等奖'; ?></td>
					<td><?php echo $prizeType[$item->type]; ?></td>
					<td><span class="blue">
							<?php 
								switch ($item->audit_state) {
									case 1:
										echo '审核中';
										break;
									case 2:
										echo '审核通过';
										break;
									case 3:
										echo '审核不通过';
										break;
									default:
										echo '其它';
										break;
								}
							?>
					</span></td>
					<td><span class="blue"><?php echo ($item->status == 1) ? '上架' : '下架'; ?></span></td>
					<td>
						<div class="op">
							<a href="<?php echo site_url('lotteryprize/dailyPrize'), '?lottery_id=', $item->lottery_id, '&prize_id=', $item->prize_id; ?>" class="btn">每日数量</a>
							<a href="<?php echo site_url('lotteryprize/editPrize/'. $item->prize_id), '?lottery_id=', $item->lottery_id; ?>" class="btn">编辑</a>
							<a class="btn btn-del" href="<?php echo site_url('lotteryprize/deletePrize/'. $item->prize_id), '?lottery_id=', $item->lottery_id; ?>" onclick="return confirm('确定删除吗')">删除</a>
						</div>
					</td>
				</tr>
				<?php endforeach; ?>
			</tbody>
		</table>
		<?php $this->load->view('layout/pagination') ?>
		<?php else :?>
            <div class="no-data">
                <img src="skins/images/panda.jpg"/>
                <p>没有搜索到结果</p>
            </div>
        <?php endif;?>
	</div>
</div>

<?php $this->load->view('layout/lottery/footer') ?>
<?php $this->load->view('layout/lottery/message') ?>